<%include inc/header.ejs%>

<table id="table" class="data-table"></table>
<div id="tb" style="padding:2px 5px;display: block; float: left; width: 100%;">
    <div style="padding: 2px 0px 3px 0px; display: block; float: left; width: 100%;" id="opt-auth-linkbutton"></div>
    <div style="padding: 3px 0px 3px 0px; display: block; float: left; width: 100%;">
        Date From: <input class="easyui-datebox" style="width:110px">
        To: <input class="easyui-datebox" style="width:110px">
        Language:
        <select data-options="editable:false" class="easyui-combobox" panelHeight="auto" style="width:100px">
            <option value="java">Java</option>
            <option value="c">C</option>
            <option value="basic">Basic</option>
            <option value="perl">Perl</option>
            <option value="python">Python</option>
        </select>
        <a href="#" class="easyui-linkbutton" iconCls="icon-search">Search</a>
    </div>
</div>


<%include inc/js.ejs%>
<script>
    var data = {"total":98,"rows":[
            {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-2221"},
            {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST44410"},
            {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"},
            {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"},
            {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"},
            {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"},
            {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"},
            {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"},
            {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"},
            {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"}
        ]};
    $(function(){
        var param = {
            toolbar:'#tb',
            data:data,
            pageSize:5,
            frozenColumns:[
                [
                    {field:'itemid',title:'itemid'},
                    {field:'productid',title:'productid'}
                ]
            ],
            columns:[
                [
                    {field:'listprice',title:'listprice'},
                    {field:'unitcost',title:'unitcost'},
                    {field:'attr1',title:'attr1'},
                    {field:'status',title:'status'}
                ]
            ],
            queryParams: { //当请求远程数据时，发送的额外参数
                name:''
            }
        }
        component.datagrid.init('#table', param);
        var pager = component.datagrid.getPager('#table');
        pager.pagination({
            onSelectPage:function (pageNumber, pageSize) {
                // alert(pageNumber)
            },
            onBeforeRefresh:function () {
                component.datagrid.load('#table', {name:1,age:2})
            }
        })
        component.linkbutton('#opt-auth-linkbutton', _auth)

    })
    function getSelections(_obj) {
        var p = {
            "loginName": "18154579950",
            "password": "20180303",
            "platform": 3
        };
        $.ajax({
            url:'http://localhost:8080/v1/common/login',
            type:'POST', //GET
            data: JSON.stringify(p),
            contentType:'application/json; charset=utf-8',
            dataType:'json',
            success:function(data,textStatus,jqXHR){
                console.log(data)
                console.log(textStatus)
                console.log(jqXHR)
            },
        })
    }

</script>

<%include inc/dot-template.ejs%>
<%include inc/footer.ejs%>